﻿namespace MealCardManagement.Data.Migrations
{
    using System;
    using System.Data.Entity;
    using System.Data.Entity.Migrations;
    using System.Linq;

    public sealed class Configuration : DbMigrationsConfiguration<MealCardManagement.Data.MCMContext>
    {
        public Configuration()
        {
            AutomaticMigrationsEnabled = false;
        }

        protected override void Seed(MealCardManagement.Data.MCMContext context)
        {
            var z3 = new User("张三");
            var z3c = z3.CreateNewCard();
            z3c.Money = 100;

            var l4 = new User("李四");
            var l4c = l4.CreateNewCard();
            l4c.Money = 120;

            context.Users.AddOrUpdate(
                x => x.Name,
                z3, l4);

            base.Seed(context);
        }
    }
}
